<? include_once("class/Usuario.class.php"); ?>
<?php
session_start(); 
$unUsuario = $_SESSION["admin"];
if ($_SESSION["admin"]) {
	if ($unUsuario->esAdmin != 1)
		header("Location: facturasListar.php");
	else
		header("Location: usuarioListar.php");
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title>MagicInvoices - Login</title>
	
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="description" content="EasyAdmin - Login" />
  <meta name="author" content="JohnGR" />
  <meta name="robots" content="nofollow" />
  
  <!-- Favicon & styles -->
  <link rel="shortcut icon" href="img/favicon.ico" />
  <link type="text/css" rel="stylesheet" href="css/style.css" />
  
  <!-- Skins (uncomment the style you want to change the skin) -->
    <!-- <link type="text/css" rel="stylesheet" href="css/skins/green.css" /> -->
    <!-- <link type="text/css" rel="stylesheet" href="css/skins/darkred.css" /> -->
    <!-- <link type="text/css" rel="stylesheet" href="css/skins/purple.css" /> -->
  <!-- END OF Skins -->
  
  <!-- END OF Favicon & styles -->
	
	<!--[if IE 6]>
		<link type="text/css" rel="stylesheet" href="css/ie6.css" />
	<![endif]-->
</head>

<!-- Header -->
  <body

	<!-- Header -->
  <div id="header-login"><a href="login.php" class="logo"><img src="img/logo-web-facturas-corto.png" /> - </a></div>
  
  <!-- Login container -->
  <div id="login-container" class="radius">
  
  	<?php if ($_GET["error"] == 1) { ?>
    	<div class="msg-error hidethis">Invalid Username/Password!</div>
		<?php } ?>
    <?php if ($_GET["logout"] == 1) { ?>
    	<div class="msg-ok hidethis">You were successfully logged out!</div>
		<?php } ?>
    
    <br />
    
    <form action="inc/admin.login.php" method="post">
      <label for="admin_uname">Username:</label><br />
      <input type="text" id="admin_uname" name="admin_uname" class="box-medium tooltip-left" title="Enter your username here" />
      <br />
      <label for="admin_uname">Password:</label><br />
      <input type="password" id="admin_pass" name="admin_pass" class="box-medium tooltip-left" title="Enter your password here" />
      <br /><br />
      <input type="submit" value="Login" class="btn-grey radius tooltip-bottom" title="Just click it to login, I entered the data for you :)" />
    </form>
    
  </div>
  <!-- END OF Login container -->

  <!-- Javascript -->  
  
  	<!-- Jquery -->
    <!-- You can include the jquery form googleapis.com to save bandwidth -->
    <!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> -->
    <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> 
    
    <!-- Tooltip (jquery plugin) -->
    <script src="js/jquery.tipsy.js" type="text/javascript"></script>
    
    <script type="text/javascript"> <!-- Custom code -->
      $(function() {
          // Hide divs
          // Enter the class 'hidethis' in a div and you can hide it 
          // when you click it, used here for the message divs
          $("div.hidethis").click(function(){$(this).slideUp("fast");});
          
          // Tooltip Configuration
          // Enter one of the following classes (eg 'tooltip-top') to an element and to the
          // title attribute of it add the text you want to appear in the tooltip.
					// You can set the fade to true for a fade in/out effect
          $('.tooltip-top').tipsy({fade: false, gravity: 's'});
          $('.tooltip-right').tipsy({fade: false, gravity: 'w'});
          $('.tooltip-bottom').tipsy({fade: false, gravity: 'n'});
          $('.tooltip-left').tipsy({fade: false, gravity: 'e'});
      });
    </script>
  <!-- END OF Javascript -->
  
</body>

</html>